/**
 * @(#) WelfareFacade.as
 *
 * @date		2009. 02. 17.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (제증명신청)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다. 
 */
package com.skt.common_hr.welfare
{
	import com.skt.common_hr.common.puremvc.CommonFacade;
	import com.skt.common_hr.welfare.controller.StartupCommand;
	
	import flash.display.DisplayObject;
	
	public class WelfareFacade extends CommonFacade
	{
		public static const STARTUP:String 						= 'startup';
		public static const CLOSE_MODULE:String					= 'closeModule';
		
		public static const LOAD_GUIDE_COMPLETE:String 			= "LOAD_GUIDE_COMPLETE";
		
		public static const LOAD_VALIDREQDAYRESULT_COMPLETE:String 	= "LOAD_VALIDREQDAYRESULT_COMPLETE";
				
		public static const LOAD_WELFARE_HISTORY_COMPLETE:String 	= "LOAD_WELFARE_HISTORY_COMPLETE";
		
		public static const LOAD_WELFARE_YEAR_COMPLETE:String 	= "loadWelfareYearComplete";
		public static const LOAD_WELFARE_YEAR_FAILED:String		= "loadWelfareYearFailed";
		public static const LOAD_WELFARE_COMPLETE:String	    = 'loadWelfareComplete';
		public static const LOAD_WELFARE_FAILED:String	    	= 'loadWelfareFailed';
		public static const LOAD_WELFARE_DETAIL_COMPLETE:String	= 'loadWelfareDetailComplete';
		public static const LOAD_WELFARE_DETAIL_FAILED:String	= 'loadWelfareDetailFailed';
		public static const LOAD_CODE_LIST_COMPLETE:String		= "loadCodeListComplete";
		public static const LOAD_CODE_LIST_FAILED:String		= "loadCodeListFailed";
		public static const LOAD_BANK_ACCOUNT_COMPLETE:String	= "loadBankAccountComplete";
		public static const LOAD_BANK_ACCOUNT_FAILED:String		= "loadBankAccountFailed";
		public static const SAVE_WELFARE_COMPLETE:String		= "saveWelfareComplete";
		public static const SAVE_WELFARE_FAILED:String			= "saveWelfareFailed";
		public static const UPDATE_WELFARE_COMPLETE:String		= "updateWelfareComplete";
		public static const UPDATE_WELFARE_FAILED:String		= "updateWelfareFailed";
		public static const DELETE_WELFARE_COMPLETE:String		= "deleteWelfareComplete";
		public static const DELETE_WELFARE_FAILED:String		= "deleteWelfareFailed";
		public static const CLOSED_REQ_VIEW:String				= "closedReqView";
		public static const LOAD_WALFARE_WRITE_INITIAL:String	= "loadWalfareWriteInitial";
		public static const CANCEL_WELFARE_VIEW:String			= "cancelWelfareView";
		public static const CANCEL_WELFARE:String				= "cancelWelfare";
		public static const LOAD_ACCOUNT_SAVE_COMPLETE:String	= "loadAccountSaveComplete";
		public static const LOAD_ACCOUNT_SAVE_FAILED:String		= "loadAccountSaveFailed";
		public static const RELOAD_ACCOUNT_INFO:String			= "reloadAccountInfo";
		public static const RELOAD_BANK_ACCOUNT_COMPLETE:String	= "reloadBankAccountComplete";
		public static const RELOAD_BANK_ACCOUNT_FAILED:String	= "reloadBankAccountFailed";
		
		public static const LOAD_PRINT_MONEY_COMPLETE:String	= "LoadPrintMoneyComplete";
		public static const LOAD_PRINT_DETAIL_COMPLETE:String	= "LoadPrintDetailComplete";
		public static const LOAD_PRINT_USERINFO_COMPLETE:String	= "LoadPrintUserinfoComplete";
		public static const LOAD_PRINT_USERINFO_FAILED:String	= "LoadPrintUserinfoFailed";
		public static const QUICK_MODIFY_VIEW:String 			= "quickModifyView";
		
		public static const LOAD_TRADECODE_LIST_COMPLETE:String	= "loadTradecodeListComplete";
		public static const LOAD_TRADECODE_LIST_FAILED:String	= "loadTradecodeListFailed";
		
		
		public function WelfareFacade( key:String )
		{
			super(key);	
		}
		
        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : WelfareFacade 
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new WelfareFacade( key );
            return instanceMap[ key ] as WelfareFacade;
        }

        /**
         * Register Commands with the Controller 
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();            
            registerCommand( STARTUP, StartupCommand);
        }
       
        /**
         * Module의 시작점으로 Welfare.mxml의 creationComplete 이벤트에서 호출한다.
         *     
         */
        public function startup(app:Object) :void 
        {
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }
		
	}
}